﻿

  Date.prototype.format = function(format) {
        var o = {
            "M+": this.getMonth() + 1, //month
            "d+": this.getDate(),    //day
            "h+": this.getHours(),   //hour
            "m+": this.getMinutes(), //minute
            "s+": this.getSeconds(), //second
            "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
            "S": this.getMilliseconds() //millisecond 
        }
        if (/(y+)/.test(format))
            format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
        return format;
    }
    Date.prototype.DateDiff = function(strInterval, dtEnd) {
        var dtStart = this;
        switch (strInterval) {
            case 's': return parseInt((dtEnd - dtStart) / 1000);
            case 'n': return parseInt((dtEnd - dtStart) / 60000);
            case 'h': return parseInt((dtEnd - dtStart) / 3600000);
            case 'd': return parseInt((dtEnd - dtStart) / 86400000);
            case 'w': return parseInt((dtEnd - dtStart) / (86400000 * 7));
            case 'm': return (dtEnd.getMonth() + 1) + ((dtEnd.getFullYear() - dtStart.getFullYear()) * 12) - (dtStart.getMonth() + 1);
            case 'y': return dtEnd.getFullYear() - dtStart.getFullYear();
        }
    };     
    function renderOnLastUpdateDate(value) {
        var d = Ext.Date.format(new Date(parseInt(value.substring(6, value.length - 2))),'Y-m-d');
        if(d=='1-1-1' || d=='1900-1-1')
            return "";
        return d;
        //var jsondate = value;

       // return eval("new " + jsondate.substr(1, jsondate.length - 2)).toDateString();
       // var a =new Date();
       // a.
    };
var changeDate=function(objList)
{
    for(var obj in objList)
    {
       if(objList[obj].indexOf('Date(')>0)
            objList[obj]=renderOnLastUpdateDate(objList[obj]);
    }
};

/////////////////////////////////////////////////////////////////////////model
  Ext.define('workflow.models.dict', {
  extend: 'Ext.data.Model',
  alias:'widget.dict',
  fields: [
  { type:'string', name: 'id' },
  { type:'string', name: 'type' },
  { type:'string', name: 'text' },
  { type:'string', name: 'Remark' },
  { type:'string', name: 'ParentID' },
  { type:'string', name: 'IsGroup' },
  { type:'int', name: 'orderID' }
  ]
  });
  
  Ext.define('workflow.models.org', {
  extend: 'Ext.data.Model',
  alias:'widget.org',
  fields: [
  { type:'string', name: 'id' },
  { type:'string', name: 'ParentID' },
  { type:'string', name: 'orderID' },
  { type:'string', name: 'isgroup' },
  { type:'string', name: 'dwCode' },
  { type:'string', name: 'dwName' },
  { type:'int', name: 'dwType' },
  { type:'int', name: 'dwOwner' },
  { type:'int', name: 'Remark' }
  ]
  });
  
  Ext.define('mainmodel', {
  extend: 'Ext.data.Model',
  //idProperty: 'id',
  fields: [
  { name: 'id',  type:'string'},
  { name: 'gdgs', type:'string' },
  {  name: 'yhjt',type:'string' },
  {  name: 'yhly',type:'string' },
  { type:'string', name: 'yhbh' },
  { type:'string', name: 'yhdwID' },
  { type:'string', name: 'yhdw' },
  { type:'string', name: 'yhzyfl' },
  { type:'string', name: 'yhfxr' },
  { type:'string', name: 'fxrdwID' },
  { type:'string', name: 'fxrdw' },
  { type:'string', name: 'fxrq'},
  { type:'string', name: 'fxyhnr' },
  { type:'string', name: 'knhg' },
  { type:'string', name: 'ypgdj' },
  { type:'string', name: 'ypgfzr' },
  { type:'string', name: 'ypgrq1' },
  { type:'string', name: 'ypgsh2' },
  { type:'string', name: 'ypgrq2' },
  { type:'string', name: 'ypgsh3' },
  { type:'string', name: 'ypgrq3' },
  { type:'string', name: 'pgdj' },
  { type:'string', name: 'pgfzr' },
  { type:'string', name: 'pgrq1' },
  { type:'string', name: 'pgsh2' },
  { type:'string', name: 'pgrq2' },
  { type:'string', name: 'pgsh3' },
  { type:'string', name: 'pgrq3' },
  { type:'string', name: 'pgsh4' },
  { type:'string', name: 'pgrq4' },
  { type:'string', name: 'ykcs' },
  { type:'string', name: 'zgcs' },
  { type:'string', name: 'zldw' },
  { type:'string', name: 'zlr' },
  { type:'string', name: 'zlrq1' },
  { type: 'string', name: 'zlrq2' },
  { type:'string', name: 'zlwcqc' },
  { type:'string', name: 'yssqdw' },
  { type:'string', name: 'yssqfzr' },
  { type:'string', name: 'yssqrq' },
  { type:'string', name: 'yszzdw' },
  { type:'string', name: 'ysyj' },
  { type:'string', name: 'ysjl' },
  { type:'string', name: 'yssfxc' },
  { type:'string', name: 'yszz' },
  { type:'string', name: 'ysrq' },
  { type:'string', name: 'lcflag' },
  { type:'string', name: 'tjflag' },
  { type:'string', name: 'bhflag' },
  { type:'string', name: 'gsbm' },
  { type:'string', name: 'tjr' },
  { type:'string', name: 'dqyh' },
  { type:'string', name: 'dqyhsj' },
  { type:'string', name: 'backflag' },
  { type:'string', name: 'backer' },
  { type:'string', name: 'backdate' },
  { type:'string', name: 'lcstatus' },
  { type:'string', name: 'zlflag' },
  { type:'string', name: 'zlstatus' },
  { type:'string', name: 'tjrq' },
  { type:'string', name: 'lcrecord' },
  { type:'string', name: 'fxrgh' },
  { type:'string', name: 'sfzykz' },
  { type:'string', name: 'jlje' },
  { type:'string', name: 'khje' }
  ]
  });
  
   var g_yhjt=100;
  var g_zt=100;
  var g_ypgdj=100;
  var g_pgdj=100;
  var g_fxrq1=100;
  var g_fxrq2=100;
  var g_yhszdw=100;
  var g_yhbh=100;
  var g_yhly=100;
  var g_gsbm=100;
  var g_sfxc=100;
  var g_yhzyfl=100; 
  
  ////////////////////////////////////////////////////////////////store
var searchStore=Ext.create('Ext.data.Store',{
                    model:'mainmodel',
                    //autoLoad: true,
                    autoSync: true,
                    pageSize:12,
                    //queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        api: {
                        read: 'search_ajax.aspx?action=read',
                        update: 'search_ajax.aspx?action=update'
                        },
                        reader: {
                            type: 'json',
                            successProperty: 'success',
                            root: 'data',
                            totalProperty:'total',
                            messageProperty: 'message'
                        },
                        writer: {
                            type: 'json' ,
                            root: 'data'      
                        },
                        extraParams: {
                            yhjt: g_yhjt,
                            zt:g_zt,
                            ypgdj:g_ypgdj,
                            pgdj:g_pgdj,
                            fxrq1:g_fxrq1,
                            fxrq2:g_fxrq2,
                            yhszdw:g_yhszdw,
                            yhbh:g_yhbh,
                            yhly:g_yhly,
                            gsbm:g_gsbm,
                            sfxc:g_sfxc,
                            yhzyfl:g_yhzyfl,
                            check:"true"
                        },
                        listeners: {
                            exception: function(proxy, response, operation) {
                                Ext.MessageBox.show({
                                    title: 'REMOTE EXCEPTION',
                                    msg: operation.getError(),
                                    icon: Ext.MessageBox.ERROR,
                                    buttons: Ext.Msg.OK
                                });
                            }
                        },
                        callback:function(){
                        
                        //alert(taskStore.items.count);
                            //for(var i=0;i<taskStore.items.count
                           // changeDate(this.items[0].data);
                        }
                    },
                    listeners:{
                       load : function() {     
                           var records = new Array();     
                           searchStore.each(function(record) {     
                               if (selectids.indexOf(record.data.id)>0)
                                    records.push(record);     
                           });     
                           selMod.select(records, true);  
                       }
                    }
                });
var knhgStore=Ext.create('Ext.data.Store',{
                    model:'workflow.models.dict',
                    autoLoad: true,
                    autoSync: true,
                    queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        url: '../workflow/workflow_dict_ajax.aspx?action=read&sType=可能导致后果',
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                        }
                    
                }); 
var yssfxcStore=Ext.create('Ext.data.Store',{
                    fields:[{name:'text',type:'string'}],
                    queryMode: 'local',
                    data:[{'text':'是'},{'text':'否'}]
                    
                });

var yhlyStore=Ext.create('Ext.data.Store',{
                    model:'workflow.models.dict',
                    autoLoad: true,
                    autoSync: true,
                    queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        url: '../workflow/workflow_dict_ajax.aspx?action=read&sType=隐患来源&search=1',
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                        }
                    
                });
var khjeStore=Ext.create('Ext.data.Store',{
                    model:'workflow.models.dict',
                    autoLoad: true,
                    //autoSync: true,
                    //queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        url: '../workflow/workflow_dict_ajax.aspx?action=read&sType='+encodeURIComponent('考核金额'),
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                        }
                    
                });
var yhzyflStore=Ext.create('Ext.data.Store',{
                    model:'workflow.models.dict',
                    autoLoad: true,
                    autoSync: true,
                    queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        url: '../workflow/workflow_dict_ajax.aspx?action=read&sType=专业分类&search=1',
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                        }
                    
                });
                

var ypgdjStore = Ext.create('Ext.data.Store',{
                    model:'workflow.models.dict',
                    autoLoad: true,
                    autoSync: true,
                    queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        url: '../workflow/workflow_dict_ajax.aspx?action=read&sType=预评估等级&search=1',
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                        }
                });  
                
  

var orgStore=Ext.create('Ext.data.Store',{
                    model:'workflow.models.org',
                    autoLoad: true,
                    autoSync: true,
                    queryMode: 'local',
                    proxy: {
                        type: 'ajax',
                        url: '../workflow/workflow_org_ajax.aspx?action=read&type=org',
                        reader: {
                            type: 'json',
                            root: 'data'
                        }
                        }
                    
                });
 
 
/////////////////////////////////////////////////////views

Ext.define('search.recordlg', {
    extend: 'Ext.window.Window',
    alias:'widget.recordlg',
    modal:true,
    height: 250,
    width: 400,
    layout: {
        type: 'fit'
    },
    title: '流程记录',

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'textareafield',
                    id: 'lcrecord',
                    name: 'lcrecord',
                    fieldLabel: ''
                }
            ]
        });

        me.callParent(arguments);
    }
});

Ext.define('search.mainform', {
    extend: 'Ext.form.Panel',
    alias: 'widget.mainform',
    border: '',
    height: 1240,
    id: 'form_total',
    autoScroll: true,
    title: '隐患排查治理档案表',


    initComponent: function() {
        var me = this;
        Ext.applyIf(me, {
            dockedItems: [{
                xtype: 'toolbar',
                hidden:true,
                items: [{
                    iconCls: 'icon-exec',
                    text: '上报',
                    itemId: 'mainexec',
                    id:'mainexec',
                    scope: this,
                    handler: this.onExecClick
                },
                {
                    iconCls: 'icon-reset',
                    text: '退回',
                    itemId: 'back',
                    id:'back',
                    scope: this,
                    handler: this.onBackClick
                }]
                }],
            items: [
                {
                    xtype: 'panel',
                    height: 265,
                    id: 'discover$100$101$102$103$104$105$106$107$108',
                    layout: {
                        type: 'anchor'
                    },
                    collapsible: true,
                    title: '发现',
                    items: [
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yhjt@100@101@102@103@104@105@106@107@108',
                                    width: 459,
                                    name: 'yhjt',
                                    fieldLabel: '　事故隐患简题',
                                    labelWidth: 90,
                                    emptyText: '',
                                    columnWidth: 0.8
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yhly@100@101@102@103@104@105@106@107@108',
                                    name: 'yhly',
                                    fieldLabel: '　隐患来源',
                                    labelWidth: 65,
                                    editable: false,
                                    columnWidth: 0.2
//                                    ,
//                                    displayField:'text',
//                                    valueField:'text',
//                                    store:yhlyStore
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yhbh@100@101',
                                    name: 'yhbh',
                                    fieldLabel: '　隐患编号',
                                    labelWidth: 90,
                                    blankText: '',
                                    columnWidth: 0.33
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yhdw@100@101',
                                    name: 'yhdw',
                                    fieldLabel: '　隐患所在单位',
                                    labelWidth: 90,
                                    editable: false,
                                    columnWidth: 0.34
//                                    ,
//                                    displayField:'dwName',
//                                    valueField:'dwName',
//                                    store:orgStore
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yhzyfl@100@101@102@103@104',
                                    name: 'yhzyfl',
                                    fieldLabel: '　专业分类',
                                    labelWidth: 65,
                                    editable: false,
                                    columnWidth: 0.33
//                                    ,
//                                    displayField:'text',
//                                    valueField:'text',
//                                    store:yhzyflStore
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yhfxr@100@101',
                                    itemId: '',
                                    name: 'yhfxr',
                                    fieldLabel: '　隐患发现人',
                                    labelStyle: '',
                                    labelWidth: 90,
                                    columnWidth: 0.21
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'fxrgh@100@101',
                                    itemId: '',
                                    name: 'fxrgh',
                                    fieldLabel: '　发现人工号',
                                    labelStyle: '',
                                    labelWidth: 90,
                                    columnWidth: 0.21
                                },
                                {
                                    xtype: 'checkboxfield',
                                    disabled: true,
                                    id: 'sfzykz_100_101',
                                    fieldLabel: '　是否主业开支',
                                    name:'sfzykz',
                                    labelWidth: 95,
                                    boxLabel: '',
                                    columnWidth: 0.14
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'fxrdw@100@101',
                                    name: 'fxrdw',
                                    fieldLabel: '　发现人单位',
                                    labelWidth: 90,
                                    editable: false,
                                    columnWidth: 0.23
//                                    ,
//                                    displayField:'dwName',
//                                    valueField:'dwName',
//                                    store:orgStore
                                },
                                {
                                    xtype: 'datefield',
                                    disabled: true,
                                    id: 'fxrq@100@101',
                                    invalidText: '日期格式不正确（年-月-日）',
                                    name: 'fxrq',
                                    fieldLabel: '　发现日期',
                                    labelWidth: 65,
                                   // value:new Date('2011-1-1'),
                                    editable: false,
                                    format: 'Y-m-d',
                                    maxText: '日期必须小于{maxValue}',
                                    minText: '日期必须大于{minValue}',
                                    columnWidth: 0.21,
                                    listener:{
                                        change:renderOnLastUpdateDate
                                    },
                                    //renderer:renderOnLastUpdateDate
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 121,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            anchor: '100%',
                            items: [
                                {
                                    xtype: 'textareafield',
                                    disabled: true,
                                    height: 104,
                                    id:  'fxyhnr@100@101@102@103@104@105@106@107@108',//'fxyhnr@100@101_102_103_104_105_106_107_108',
                                    name: 'fxyhnr',
                                    fieldLabel: '　事故隐患内容',
                                    labelWidth: 90,
                                    columnWidth: 1
                                }
                            ]
                        }
                    ]
                },
                {
                    xtype: 'panel',
                    height: 179,
                    id: 'toassess$102$103$104$105$106$107$108',
                    layout: {
                        type: 'anchor'
                    },
                    collapsible: true,
                    title: '预评估',
                    items: [
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'knhg@102@103@104@105@106@107@108',
                                    name: 'knhg',
                                    fieldLabel: '　可能导致后果',
                                    labelWidth: 90,
                                    blankText: '',
                                    emptyText: '',
                                    editable:true,
                                    columnWidth: 0.3
//                                    ,
//                                    displayField:'text',
//                                    valueField:'text',
//                                    store:knhgStore
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'gsbm@102@103@104',
                                    name: 'gsbm',
                                    fieldLabel: '　归属职能部门',
                                    labelWidth: 125,
                                    columnWidth: 0.7
//                                    ,
//                                    displayField:'text',
//                                    valueField:'text',
//                                    store: [
//                                        ['生产部', '生产部'],
//                                        ['调度所', '调度所'],
//                                        ['发策部', '发策部']
//                                    ]
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 123,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'container',
                                    height: 120,
                                    padding: '43 0 0 5',
                                    layout: {
                                        type: 'column'
                                    },
                                    columnWidth: 0.3,
                                    items: [
                                        {
                                            xtype: 'textfield',
                                            disabled: true,
                                            id: 'ypgdj@102_103_104',
                                            name: 'ypgdj',
                                            fieldLabel: '　预评估等级',
                                            labelWidth: 90,
                                            editable: false,
                                            columnWidth: 1
//                                            ,
//                                            displayField:'text',
//                                            valueField:'text',
//                                            store:ypgdjStore
                                        }
                                    ]
                                },
                                {
                                    xtype: 'container',
                                    height: 120,
                                    width: 500,
                                    layout: {
                                        type: 'anchor'
                                    },
                                    columnWidth: 0.7,
                                    items: [
                                        {
                                            xtype: 'container',
                                            height: 40,
                                            autoScroll:false,
                                            padding: 5,
                                            layout: {
                                                type: 'column'
                                            },
                                            items: [
                                                {
                                                    xtype: 'textfield',
                                                    disabled: true,
                                                    id: 'ypgfzr@102',
                                                    name: 'ypgfzr',
                                                    fieldLabel: '预评估负责人签名',
                                                    labelWidth: 125,
                                                    columnWidth: 0.5
                                                },
                                                {
                                                    xtype: 'datefield',
                                                    disabled: true,
                                                    id: 'ypgrq1@102',
                                                    name: 'ypgrq1',
                                                    fieldLabel: '　预评估负责人签名日期',
                                                    labelWidth: 160,
                                                    format: 'Y-m-d',
                                                    editable: false,
                                                    columnWidth: 0.5
                                                }
                                            ]
                                        },
                                        {
                                            xtype: 'container',
                                            height: 40,
                                            padding: 5,
                                            layout: {
                                                type: 'column'
                                            },
                                            items: [
                                                {
                                                    xtype: 'textfield',
                                                    disabled: true,
                                                    id: 'ypgsh2@103',
                                                    name: 'ypgsh2',
                                                    fieldLabel: '规范性审核负责人签名',
                                                    labelWidth: 125,
                                                    columnWidth: 0.5
                                                },
                                                {
                                                    xtype: 'datefield',
                                                    disabled: true,
                                                    id: 'ypgrq2@103',
                                                    name: 'ypgrq2',
                                                    fieldLabel: '　规范性审核负责人签名日期',
                                                    labelWidth: 160,
                                                    editable: false,
                                                    format: 'Y-m-d',
                                                    columnWidth: 0.5
                                                }
                                            ]
                                        },
                                        {
                                            xtype: 'container',
                                            height: 40,
                                            padding: 5,
                                            layout: {
                                                type: 'column'
                                            },
                                            items: [
                                                {
                                                    xtype: 'textfield',
                                                    disabled: true,
                                                    id: 'ypgsh3@104',
                                                    name: 'ypgsh3',
                                                    fieldLabel: '工区领导审核签名',
                                                    labelWidth: 125,
                                                    columnWidth: 0.5
                                                },
                                                {
                                                    xtype: 'datefield',
                                                    disabled: true,
                                                    id: 'ypgrq3@104',
                                                    name: 'ypgrq3',
                                                    fieldLabel: '　工区领导审核签名日期',
                                                    labelWidth: 160,
                                                    format: 'Y-m-d',
                                                    editable: false,
                                                    columnWidth: 0.5
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    xtype: 'panel',
                    height: 180,
                    id: 'assessing$105$106$107$108',
                    layout: {
                        type: 'column'
                    },
                    collapsible: true,
                    title: '评估',
                    items: [
                        {
                            xtype: 'container',
                            height: 111,
                            padding: '43 0 0 5',
                            width: 250,
                            layout: {
                                type: 'column'
                            },
                            columnWidth: 0.3,
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'pgdj@105_106_107_108',
                                    name: 'pgdj',
                                    fieldLabel: '　评估等级',
                                    labelWidth: 70,
                                    editable: false,
                                    columnWidth: 1
//                                    ,
//                                    displayField:'text',
//                                    valueField:'text',
//                                    store:ypgdjStore
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 148,
                            width: 500,
                            layout: {
                                type: 'anchor'
                            },
                            columnWidth: 0.7,
                            items: [
                                {
                                    xtype: 'container',
                                    height: 37,
                                    padding: 5,
                                    layout: {
                                        type: 'column'
                                    },
                                    items: [
                                        {
                                            xtype: 'textfield',
                                            disabled: true,
                                            id: 'pgfzr@105',
                                            name: 'pgfzr',
                                            fieldLabel: '评估负责人签名',
                                            labelWidth: 125,
                                            columnWidth: 0.5
                                        },
                                        {
                                            xtype: 'datefield',
                                            disabled: true,
                                            id: 'pgrq1@105',
                                            name: 'pgrq1',
                                            fieldLabel: '　评估负责人签名日期',
                                            labelWidth: 165,
                                            editable: false,
                                            format: 'Y-m-d',
                                            columnWidth: 0.5
                                        }
                                    ]
                                },
                                {
                                    xtype: 'container',
                                    height: 37,
                                    padding: 5,
                                    layout: {
                                        type: 'column'
                                    },
                                    items: [
                                        {
                                            xtype: 'textfield',
                                            disabled: true,
                                            id: 'pgsh2@106',
                                            name: 'pgsh2',
                                            fieldLabel: '部门负责人审核签名',
                                            labelWidth: 125,
                                            columnWidth: 0.5
                                        },
                                        {
                                            xtype: 'datefield',
                                            disabled: true,
                                            id: 'pgrq2@106',
                                            name: 'pgrq2',
                                            format: 'Y-m-d',
                                            fieldLabel: '　部门负责人审核签名日期',
                                            labelWidth: 165,
                                            editable: false,
                                            columnWidth: 0.5
                                        }
                                    ]
                                },
                                {
                                    xtype: 'container',
                                    height: 37,
                                    padding: 5,
                                    layout: {
                                        type: 'column'
                                    },
                                    items: [
                                        {
                                            xtype: 'textfield',
                                            disabled: true,
                                            id: 'pgsh3@107',
                                            name: 'pgsh3',
                                            fieldLabel: '规范性审核负责人签名',
                                            labelWidth: 125,
                                            columnWidth: 0.5
                                        },
                                        {
                                            xtype: 'datefield',
                                            disabled: true,
                                            id: 'pgrq3@107',
                                            name: 'pgrq3',
                                            fieldLabel: '　规范性审核负责人签名日期',
                                            labelWidth: 165,
                                            format: 'Y-m-d',
                                            editable: false,
                                            columnWidth: 0.5
                                        }
                                    ]
                                },
                                {
                                    xtype: 'container',
                                    height: 37,
                                    padding: 5,
                                    layout: {
                                        type: 'column'
                                    },
                                    items: [
                                        {
                                            xtype: 'textfield',
                                            disabled: true,
                                            id: 'pgsh4@108',
                                            name: 'pgsh4',
                                            fieldLabel: '地市领导审核签名',
                                            labelWidth: 125,
                                            columnWidth: 0.5
                                        },
                                        {
                                            xtype: 'datefield',
                                            disabled: true,
                                            id: 'pgrq4@108',
                                            name: 'pgrq4',
                                            fieldLabel: '　地市领导审核签名日期',
                                            labelWidth: 165,
                                            format: 'Y-m-d',
                                            columnWidth: 0.5
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    xtype: 'panel',
                    height: 163,
                    id: 'method$102$103$104$105$106$107$108',
                    layout: {
                        type: 'anchor'
                    },
                    collapsible: true,
                    title: '措施',
                    items: [
                        {
                            xtype: 'textareafield',
                            disabled: true,
                            height: 60,
                            id: 'ykcs@102_103_104_105_106_107_108',
                            margin: 5,
                            name: 'ykcs',
                            fieldLabel: '　预控措施',
                            labelWidth: 70,
                            anchor: '100%'
                        },
                        {
                            xtype: 'textareafield',
                            disabled: true,
                            height: 60,
                            id: 'zgcs_102_103_104@105_106_107_108',
                            margin: 5,
                            name: 'zgcs',
                            fieldLabel: '　整改措施',
                            labelWidth: 70,
                            anchor: '100%'
                        }
                    ]
                },
                {
                    xtype: 'panel',
                    height: 160,
                    id: 'govern$102$103$104$105$106$107$108$200$201',
                    layout: {
                        type: 'anchor'
                    },
                    collapsible: true,
                    title: '治理',
                    items: [
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'zldw_102_103_104@105_106_107_108_200',
                                    name: 'zldw',
                                    fieldLabel: '　治理责任单位',
                                    labelWidth: 90,
                                    editable: false,
                                    columnWidth: 0.6
//                                    ,
//                                    displayField:'dwName',
//                                    valueField:'dwName',
//                                    store:orgStore
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'zlr_102_103_104@105_106_107_108_200',
                                    name: 'zlr',
                                    fieldLabel: '　治理责任人',
                                    labelWidth: 80,
                                    columnWidth: 0.4
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'datefield',
                                    disabled: true,
                                    id: 'zlrq1_102_103_104@105_106_107_108_200_201',
                                    name: 'zlrq1',
                                    fieldLabel: '　治理期限，自',
                                    labelWidth: 90,
                                    editable: false,
                                    format: 'Y-m-d',
                                    columnWidth: 0.6
                                },
                                {
                                    xtype: 'datefield',
                                    disabled: true,
                                    id: 'zlrq2_102_103_104@105_106_107_108_200_201',
                                    name: 'zlrq2',
                                    fieldLabel: '　至',
                                    labelWidth: 40,
                                    editable: false,
                                    format: 'Y-m-d',
                                    columnWidth: 0.4
                                }
                            ]
                        },
                        {
                            xtype: 'textareafield',
                            disabled: true,
                            height: 50,
                            id: 'zlwcqc_107@200_201',
                            name: 'zlwcqc',
                            fieldLabel: '　 治理完成情况',
                            labelWidth: 95,
                            anchor: '100%'
                        }
                    ]
                },
                {
                    xtype: 'panel',
                    height: 240,
                    id: 'check$107$200$201',
                    layout: {
                        type: 'anchor'
                    },
                    collapsible: true,
                    title: '验收',
                    items: [
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yssqdw_107@200@201',
                                    name: 'yssqdw',
                                    fieldLabel: '　验收申请单位',
                                    labelWidth: 90,
                                    editable: false,
                                    columnWidth: 0.4
//                                    ,
//                                    displayField:'dwName',
//                                    valueField:'dwName',
//                                    store:orgStore
                                },
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yssqfzr_107@200@201',
                                    name: 'yssqfzr',
                                    fieldLabel: '　负责人',
                                    labelWidth: 60,
                                    columnWidth: 0.3
                                },
                                {
                                    xtype: 'datefield',
                                    disabled: true,
                                    id: 'yssqrq_107@200@201',
                                    name: 'yssqrq',
                                    fieldLabel: '　日期',
                                    labelWidth: 50,
                                    editable: false,
                                    format: 'Y-m-d',
                                    columnWidth: 0.3
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yszzdw_107@200@201',
                                    name: 'yszzdw',
                                    fieldLabel: '　验收组织单位',
                                    labelWidth: 90,
                                    editable: false,
                                    columnWidth: 1
//                                    ,
//                                    displayField:'dwName',
//                                    valueField:'dwName',
//                                    store:[
//                                        ['生产部', '生产部'],
//                                        ['调度所', '调度所'],
//                                        ['发策部', '发策部']
//                                    ]
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 65,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textareafield',
                                    disabled: true,
                                    height: 50,
                                    id: 'ysyj_107@201',
                                    width: 658,
                                    name: 'ysyj',
                                    fieldLabel: '　验收意见',
                                    labelWidth: 90,
                                    columnWidth: 1
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'ysjl_107@201',
                                    name: 'ysjl',
                                    fieldLabel: '　结　　论',
                                    labelWidth: 90,
                                    columnWidth: 0.7
                                },
                                {
                                    xtype: 'combobox',
                                    disabled: true,
                                    id: 'yssfxc_107@201',
                                    name: 'yssfxc',
                                    fieldLabel: '　是否消除',
                                    labelWidth: 70,
                                    editable: false,
                                    columnWidth: 0.3,
                                    displayField:'text',
                                    valueField:'text',
                                    store:yssfxcStore
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            height: 37,
                            padding: 5,
                            layout: {
                                type: 'column'
                            },
                            items: [
                                {
                                    xtype: 'textfield',
                                    disabled: true,
                                    id: 'yszz_107@201',
                                    name: 'yszz',
                                    fieldLabel: '　验收组长',
                                    labelWidth: 90,
                                    columnWidth: 0.7
                                },
                                {
                                    xtype: 'datefield',
                                    disabled: true,
                                    id: 'ysrq_107@201',
                                    name: 'ysrq',
                                    fieldLabel: '　验收日期',
                                    labelWidth: 70,
                                    editable: false,
                                    format: 'Y-m-d',
                                    columnWidth: 0.3
                                }
                            ]
                        }
                    ]
                },
                {
                    xtype: 'images-view'
                  }
            ]
        });

        me.callParent(arguments);
    },
   
    setActiveRecord: function(record) {
                    this.activeRecord = record;
                    if (record) {
                        this.getForm().loadRecord(record);
                         Ext.getCmp('images-view').setActiveRecord(record);
                        Ext.getCmp('addimage').setVisible(false);
                        Ext.getCmp('deleteimage').setVisible(false);
                    } else {
                        this.getForm().reset();
                    }
                }
});



Ext.define('search.options', {
    extend: 'Ext.container.Container',
    alias:'widget.search',
    height: 38,
    layout: {
        type: 'anchor'
    },

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            items: [
                {
                    xtype: 'container',
                    height: 38,
                    padding: 5,
                    layout: {
                        type: 'column'
                    },
                    items: [
                        {
                            xtype: 'textfield',
                            id: 'yhjt',
                            margin: '0 5 0 0',
                            name: 'yhjt',
                            fieldLabel: '事故隐患简题',
                            labelWidth: 85,
                            hidden:true,
                            columnWidth: 0.19
                        },
                        {
                            xtype: 'combobox',
                            id: 'zt',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'zt',
                            fieldLabel: '状态',
                            labelWidth: 40,
                            editable: false,
                            columnWidth: 0.17,
                            store:[
                               [ '全部', '全部'],
                               [ '已上报', '已上报'],
                               [ '市级上报待评估','市级上报待评估'],
                               [ '已完成预评估','已完成预评估'],
                               [ '已完成规范性审核','已完成规范性审核'],
                               [ '已完成二级单位领导审核', '已完成二级单位领导审核'],
                               [ '已完成部门评估', '已完成部门评估'],
                               [ '已完成部门审核', '已完成部门审核'],
                               [ '已完成规范性审核', '已完成规范性审核'],
                               [ '已完成公司领导审核', '已完成公司领导审核']
                            ]
                        },{
                            xtype: 'combobox',
                            id: 'ypgdj',
                            //hidden:true,
                            margin: '0 5 0 0',
                            name: 'ypgdj',
                            fieldLabel: '预评估等级',
                            labelWidth: 70,
                            editable: false,
                            columnWidth: 0.17,
                            store:ypgdjStore
                        },
                        {
                            xtype: 'combobox',
                            id: 'pgdj',
                            //hidden:true,
                            margin: '0 5 0 0',
                            name: 'pgdj',
                            fieldLabel: '评估等级',
                            labelWidth: 60,
                            editable: false,
                            columnWidth: 0.17,
                            store:ypgdjStore
                        },
                        {
                            xtype: 'datefield',
                            id: 'fxrq1',
                            name: 'fxrq1',
                            fieldLabel: '验收日期',
                            labelWidth: 60,
                            editable: false,
                            format: 'Y-m-d',
                            columnWidth: 0.17
                        },
                        {
                            xtype: 'datefield',
                            id: 'fxrq2',
                            name: 'fxrq2',
                            fieldLabel: '至',
                            labelSeparator: ' ',
                            labelWidth: 10,
                            editable: false,
                            format: 'Y-m-d',
                            columnWidth: 0.13
                        },
                        {
                            xtype: 'button',
                            text: '查询',
                            columnWidth: 0.08,
                            handler:this.onSearch
                        }
                    ]
                },
                {
                    xtype: 'container',
                    hidden:true,
                    height: 38,
                    padding: 5,
                    layout: {
                        type: 'column'
                    },
                    items: [
                        {
                            xtype: 'textfield',
                            id: 'yhszdw',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'yhszdw',
                            fieldLabel: '隐患所在单位',
                            labelWidth: 85,
                            columnWidth: 0.19
                        },
                        {
                            xtype: 'textfield',
                            id: 'yhbh',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'yhbh',
                            fieldLabel: '隐患编号',
                            labelWidth: 60,
                            columnWidth: 0.17
                        },
                        {
                            xtype: 'combobox',
                            id: 'yhly',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'yhly',
                            fieldLabel: '隐患来源',
                            labelWidth: 60,
                            editable: false,
                            columnWidth: 0.17,
                            store:yhlyStore
                        },
                        {
                            xtype: 'combobox',
                            id: 'gsbm',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'gsbm',
                            fieldLabel: '归属部门',
                            labelWidth: 60,
                            editable: false,
                            columnWidth: 0.14,
                            store:[
                                ['全部', '全部'],
                                ['生产部', '生产部'],
                                ['调度所', '调度所'],
                                ['发策部', '发策部']
                            ]
                        },
                        {
                            xtype: 'combobox',
                            id: 'yhzyfl',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'yhzyfl',
                            fieldLabel: '专业分类',
                            labelWidth: 60,
                            editable: false,
                            columnWidth: 0.14,
                            store:yhzyflStore
                        },
                        {
                            xtype: 'combobox',
                            id: 'sfxc',
                            hidden:true,
                            margin: '0 5 0 0',
                            name: 'sfxc',
                            fieldLabel: '是否消除',
                            labelWidth: 55,
                            editable: false,
                            columnWidth: 0.14,
                            store:[
                                ['全部', '全部'],
                                ['是', '是'],
                                ['否', '否']
                            ]
                        }
                    ]
                }
            ]
        });

        me.callParent(arguments);
    }
});

var selectids=",";
var selMod=Ext.create('Ext.selection.CheckboxModel', {
    listeners : {     
                  
                   select: function(model,record,index){
                        selectids+=record.data.id+",";
                   },
                   deselect: function(model,record,index){
                        selectids+record.data.id+",";
                    
                   }
                   
               } 
});
Ext.define('workflow.views.tasklist', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.tasklist',

    requires: [
        'Ext.grid.plugin.CellEditing',
        'Ext.form.field.Text',
        'Ext.toolbar.TextItem'//,
    // 'Ext.grid.CheckboxSelectionModel'
    ],
    columnLines: true,
    selModel: selMod,
//title: '考核记录',
//frame: true,
width:1200,

initComponent: function() {

    this.editing = Ext.create('Ext.grid.plugin.CellEditing');

    Ext.apply(this, {
        iconCls: 'icon-grid',
        //frame: true,
        plugins: [this.editing],
        dockedItems: [{
                     xtype: 'toolbar',
                    items: [{
                        iconCls: 'icon-grid',
                        text: '导出',
                        itemId: 'export',
                        id:'export',
                        scope: this,
                        handler: this.onExport
                    },
                    {
                        iconCls: 'icon-grid',
                        text: '查看内容',
                        itemId: 'viewcontent',
                        id:'viewcontent',
                        scope: this,
                        handler: this.onViewContent
                    }]
                    },
                    {
                        xtype: 'pagingtoolbar',
                        store: searchStore,  // same store GridPanel is using
                        dock: 'bottom', //分页 位置
                        emptyMsg: '没有数据',
                        displayInfo: true,
                        displayMsg: '当前显示{0}-{1}条记录 / 共{2}条记录 ',
                        beforePageText: '第',
                        afterPageText: '页/共{0}页'
                    }],
        columns: [Ext.create('Ext.grid.RowNumberer'),{
            text: 'id',
            width: 40,
            sortable: true,
            hidden:true,
            dataIndex: 'id'
        }, {
            header: '隐患简题',
            width: 100,
            dataIndex: 'yhjt'
        }, {
            header: '隐患来源',
            width: 100,
            dataIndex: 'yhly'
        }, {
            header: '隐患编号',
            //flex: 1,
            width: 100,
            dataIndex: 'yhbh'
        }, {
            header: '隐患所在单位',
            //flex: 1,
            width: 100,
            dataIndex: 'yhdw'
        }, {
            header: '事故隐患内容',
            //flex: 1,
            width: 100,
            dataIndex: 'fxyhnr'
        }, {
            header: '整改措施',
            //flex: 1,
            width: 100,
            dataIndex: 'zgcs'
        }, {
            header: '治理责任单位',
            //flex: 1,
            width: 100,
            sortable: true,
            dataIndex: 'zldw'
        }, {
            header: '治理责任人',
            //flex: 1,
            width: 80,
            sortable: true,
            dataIndex: 'zlr'
        }, {
            header: '考核金额',
            //flex: 1,
            width: 60,
            sortable: true,
            dataIndex: 'khje',
            editor: {
                xtype: 'combobox',
                editable: false, 
                displayField:'text',
                valueField:'text',
                store: khjeStore,
                queryMode: 'local'
                //,
                //lazyRender: true,
                //listClass: 'x-combo-list-small'
            }
        }, {
            header: '治理期限－自',
            //flex: 1,
            width: 100,
            sortable: true,
            renderer:  renderOnLastUpdateDate,
            dataIndex: 'zlrq1'
        }, {
            header: '治理期限－止',
            //flex: 1,
            width: 100,
            sortable: true,
            renderer:  renderOnLastUpdateDate,
            dataIndex: 'zlrq2'
        }, {
            header: '治理完成情况',
            //flex: 1,
            width: 100,
            sortable: true,
            dataIndex: 'zlwcqc'
        }, {
            header: '验收日期',
            //flex: 1,
            width: 100,
            sortable: true,
            dataIndex: 'ysrq',
            format:'Y-m-d',
            renderer:  renderOnLastUpdateDate
        }]
        });
        this.callParent();
        this.getSelectionModel().on('selectionchange', this.onSelectChange, this);
    },
    onSelectChange: function(selModel, selections) {
        this.down('#viewcontent').setDisabled(selections.length === 0);
        //this.down('#viewrecord').setDisabled(selections.length === 0);
    }
});

    
                                
//////////////////////////////////////////////////////all
 Ext.Loader.setConfig({ enabled: true });
Ext.Loader.setPath('Ext.ux.DataView', '../Ext.ux.UploadDialog/UploadDialog/');
Ext.require(['Ext.data.*', 'Ext.grid.*', 'Ext.util.*',
    'Ext.view.View',
    'Ext.ux.DataView.DragSelector',
       'Ext.ux.DataView.LabelEditor']);
Ext.onReady(function(){
Ext.tip.QuickTipManager.init();
//Ext.require('Ext.grid.CheckboxSelectionModel') ;

   Ext.create('Ext.Viewport', 
   
   {
   
        layout: {
            type: 'border'            
            //,padding: 5
        },
        defaults: {
            split: true
        },
        items: [{
        title: '考核记录',
        frame: true,
        region:'center',
        layout:'border',
        //border:false,
        items:[{
            xtype:'search',
            title: '查询条件',
            id:'searchoption',
            itemId:'searchoption',
            region:'north',
            collapsible: true,
           // height:80,
            //width:750,
            onSearch: function() {
                    if(Ext.getCmp('fxrq2').getValue()<Ext.getCmp('fxrq1').getValue()){
                        Ext.MessageBox.show({
                            title: '提示',
                            msg: '结束日期必须大于开始日期',
                            buttons: Ext.Msg.OK
                           });
                        }
                        else
                        {
                             g_yhjt=Ext.getCmp('yhjt').getValue();
                                g_zt=Ext.getCmp('zt').getValue();
                                g_ypgdj=Ext.getCmp('ypgdj').getValue()==null?"":Ext.getCmp('ypgdj').getValue();
                                g_pgdj=Ext.getCmp('pgdj').getValue()==null?"":Ext.getCmp('pgdj').getValue();
                                g_fxrq1=Ext.getCmp('fxrq1').getValue();
                                g_fxrq2=Ext.getCmp('fxrq2').getValue();
                                g_yhszdw=Ext.getCmp('yhszdw').getValue();
                                g_yhbh=Ext.getCmp('yhbh').getValue();
                                g_yhly=Ext.getCmp('yhly').getValue()==null?"":Ext.getCmp('yhly').getValue();
                                g_gsbm=Ext.getCmp('gsbm').getValue();
                                g_sfxc=Ext.getCmp('sfxc').getValue();
                                g_yhzyfl=Ext.getCmp('yhzyfl').getValue()==null?"":Ext.getCmp('yhzyfl').getValue();
                                
                                searchStore.setProxy(
                                {
                                    type: 'ajax',
                                    api: {
                                    read: 'search_ajax.aspx?action=read',
                                    update: 'search_ajax.aspx?action=update'
                                    },
                                    reader: {
                                        type: 'json',
                                        successProperty: 'success',
                                        root: 'data',
                                        totalProperty:'total',
                                        messageProperty: 'message'
                                    },
                                    writer:{
                                        type: 'json',
                                        root: 'data'
                                    },
                                    extraParams: {
                                        yhjt: g_yhjt,
                                        zt:g_zt,
                                        ypgdj:g_ypgdj,
                                        pgdj:g_pgdj,
                                        fxrq1:g_fxrq1,
                                        fxrq2:g_fxrq2,
                                        yhszdw:g_yhszdw,
                                        yhbh:g_yhbh,
                                        yhly:g_yhly,
                                        gsbm:g_gsbm,
                                        sfxc:g_sfxc,
                                        yhzyfl:g_yhzyfl,
                                        check:"true"
                                    },
                                    listeners: {
                                        exception: function(proxy, response, operation) {
                                        if(operation.getError().Length>0)
                                            Ext.MessageBox.show({
                                                title: 'REMOTE EXCEPTION',
                                                msg: operation.getError(),
                                                icon: Ext.MessageBox.ERROR,
                                                buttons: Ext.Msg.OK
                                            });
                                        }
                                    }
                                }
                            );
                             searchStore.load();
                             selectids=",";
                        }
                        
                    }
        },{
        layout: {
            type: 'border'
            //,padding: 5
        },
        defaults: {
            split: false
        },
        region:'center',
        border:false,
        items:[{
            xtype:'tasklist',
            id:'tasklist1',
            region:'center',
            //width:1200,
            collapsible: false,
            //frame: true,
            //height:200,
            store:searchStore,
            onViewContent:function(){
                var contentdlg=Ext.create('Ext.window.Window', {
                                            width: 810,
                                            height: 500,
                                            closable: true,
                                            draggable: true,
                                            resizable: false,
                                            maximized:false,
                                            modal:true,
                                            title:'查看内容',
                                            id:'content1',
                                            layout: {
                                                type: 'hbox',
                                                align: 'stretch'
                                            },
                                            items: [{
                                                xtype:'mainform',
                                                id:'mainform1'
                                                }]
                                       });
                var selection = this.getView().getSelectionModel().getSelection()[0];
                changeDate(selection.data);
                Ext.getCmp('mainform1').setActiveRecord(selection);
                contentdlg.show();
                                                                    
            },
            onViewRecord:function(){
                var selection = this.getView().getSelectionModel().getSelection()[0];
                var dlg = new search.recordlg();
                var str=selection.data.lcrecord;
                for(var i=0;i<selection.data.lcrecord.split('->').length-1;i++)
                     str=str.replace('->','\n');
                Ext.getCmp('lcrecord').setValue(str);
                dlg.show();
            },
            onExport: function() {
                 var str = selectids;
                 if(str==",")
                 return;
                openWindow("export.aspx?sheetname=考核&type=check", str);
               
                }
              
            }]
            }]
        }]
     });
   
});

    function openWindow(str_url, dt_param) {
        var str_form_head = '<form name="tempForm" action="' + str_url + '" method="post" style="display:none">';
        var str_form_foot = '</form>';
        var str_form_param = '<textarea name="id">' + dt_param + '</textarea>';
        var str_javascript_execute = '<script type="text/javascript">document.tempForm.submit();</sc' + 'ript>';

        var arr_data = new Array();
        arr_data.push('<h3>请稍候 ...</h3>');
        arr_data.push(str_form_head);
        arr_data.push(str_form_param);
        arr_data.push(str_form_foot);
        arr_data.push(str_javascript_execute);
        var oWin = window.open('');
        oWin.document.write(arr_data.join(''));
        return oWin;
    } 


var checkNo=function(no)
{
     var re= /^\d{8}$/;
     return re.test(no);
}
                                